package com.jason.controller;

import com.jason.constant.ResponseConstant;
import com.jason.service.EmailService;
import com.jason.vo.Response;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class EmailController {

    @Autowired
    private EmailService emailService;

    @RequestMapping("/email/send")
    public Response sendEmail(@RequestParam("email") String email,
                              @RequestParam("subject") String subject,
                              @RequestParam("content") String content) {
        emailService.sendEmail(email, subject, content);
        return new Response(ResponseConstant.SUCCESS);
    }
}
